<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui" template="template/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgs.home}"/>
	</ui:define>
	<ui:define name="bodyInclude">
		<ui:include src="include/menu.xhtml" />
		<p:outputPanel layout="block" rendered="#{null != param['login'] and param['login']=='ok'}" styleClass="checkMessage">
			<h:outputText value="#{msgs.succeededAuthentication} (#{sessionController.sessionUser.lastName} #{sessionController.sessionUser.name})."/>
		</p:outputPanel>
		<p:fieldset legend="#{msgs.alarmes}" toggleable="true">
			<p:accordionPanel autoHeight="true">
				<p:tab rendered="#{sessionController.sessionUser.administrator or sessionController.sessionUser.responsable}" title="#{msgs.activitiesToDocument}">
					<p:outputPanel layout="block" styleClass="container">
						<h:form id="activitiesToDescribeForm">
							<p:dataTable currentPageReportTemplate="{currentPage} #{msgs.of} {totalPages}" emptyMessage="#{msgs.emptyDataTableMessage}" id="activitiesTable" paginator="true" paginatorAlwaysVisible="false" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport}{PageLinks}{NextPageLink} {LastPageLink}" rows="5" rowsPerPageTemplate="5,10,20,50" value="#{homeController.activitiesToDescribe}" var="activity">
								<p:column headerText="#{msgs.name}" sortBy="#{activity.label}" styleClass="center">
									<h:outputText value="#{activity.label}" />
								</p:column>
								<p:column headerText="#{msgs.actions}" styleClass="center">
									<p:commandButton action="#{homeController.onActivityDocumentation}" ajax="true" alt="#{msgs.document}" image="ui-icon ui-icon-pencil" process="@this" title="#{msgs.document}">
										<f:setPropertyActionListener target="#{activityDocumentationController.currentActivityToDocument}" value="#{activity}" />
									</p:commandButton>
								</p:column>
							</p:dataTable>
						</h:form>
					</p:outputPanel>
				</p:tab>
				<p:tab title="#{msgs.prioritizationsToDo}">
					<p:outputPanel layout="block" styleClass="container">
						<ui:include src="include/prioritizationToDoDataTable.xhtml">
							<ui:param name="source" value="#{homeController.prioritizationsToDo}" />
						</ui:include>
					</p:outputPanel>
				</p:tab>
				<p:tab rendered="#{sessionController.sessionUser.administrator or sessionController.sessionUser.responsable}" title="#{msgs.variantsToGenerate}">
					<p:outputPanel layout="block" styleClass="container">
						<h:form id="variantsToGenerateForm">
							<p:dataTable currentPageReportTemplate="{currentPage} #{msgs.of} {totalPages}" emptyMessage="#{msgs.emptyDataTableMessage}" id="variantsToGenerateTable" paginator="true" paginatorAlwaysVisible="false" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport}{PageLinks}{NextPageLink} {LastPageLink}" rows="5" rowsPerPageTemplate="5,10,20,50" value="#{homeController.testCasesVariantsToGenerate}" var="testCase">
								<p:column headerText="#{msgs.project}" sortBy="#{testCase.projectName}" styleClass="center">
									<h:outputText value="#{testCase.projectName}"/>
								</p:column>
								<p:column headerText="#{msgs.version}" sortBy="#{testCase.versionName}" styleClass="center">
									<h:outputText value="#{testCase.versionName}"/>
								</p:column>
								<p:column headerText="#{msgs.testCase}" sortBy="#{testCase.label}" styleClass="center">
									<h:outputText value="#{testCase.label}"/>
								</p:column>
								<p:column styleClass="center">
									<p:commandButton actionListener="#{homeController.onGenerateVariants}" alt="#{msgs.generate}" image="ui-icon ui-icon-gear" update="variantsToGenerateForm" title="#{msgs.generate}">
										<f:setPropertyActionListener target="#{homeController.currentTestCaseId}" value="#{testCase.testCaseId}" />
									</p:commandButton>
								</p:column>
							</p:dataTable>
						</h:form>
					</p:outputPanel>
				</p:tab>
			</p:accordionPanel>
		</p:fieldset>
	</ui:define>
</ui:composition>